#!/usr/bin/env python3
# -*- coding: utf-8 -*-

class Student(object):

    def __init__(self):
        self.name = 'Michael'

    def __getattr__(self, attr):
        if attr=='score':
            return 99
        if attr=='age':
            return lambda: 25
        raise AttributeError('\'Student\' object has no attribute \'%s\'' % attr)

s = Student()
print(s.name)
#score is one property
print(s.score)
# print(s.score()) #TypeError: 'int' object is not callable
#age is one function
print(s.age())
print(s.age) #<function Student.__getattr__.<locals>.<lambda> at 0x0000013384653E18>
# AttributeError: 'Student' object has no attribute 'grade'
# print(s.grade)
